/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.jiadakeji.ppm.modules.weixin.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jiadakeji.ppm.common.persistence.DataEntity;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.math.BigInteger;
import java.util.Date;

/**
 * 微信订单Entity
 * @author 韩浩宇
 * @version 2017-12-28
 */
public class WxpayOrder extends DataEntity<WxpayOrder> {
	
	private static final long serialVersionUID = 1L;
	private String code;		// 订单编号
	private Date tradeDate;		// 交易时间
	private Double totalPrice;		// 总价
	private String status;		// 状态
	private Date beginTradeDate;		// 开始交易时间
	private Date endTradeDate;		// 结束交易时间
	private String orderType;		// 订单类型
	private BigInteger version; //版本号

	
	public WxpayOrder() {
		super();
	}

	public WxpayOrder(String id){
		super(id);
	}

	@Length(min=1, max=64, message="订单编号长度必须介于 1 和 64 之间")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="交易时间不能为空")
	public Date getTradeDate() {
		return tradeDate;
	}

	public void setTradeDate(Date tradeDate) {
		this.tradeDate = tradeDate;
	}
	
	@NotNull(message="总价不能为空")
	public Double getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(Double totalPrice) {
		this.totalPrice = totalPrice;
	}
	
	@Length(min=0, max=1, message="状态长度必须介于 0 和 1 之间")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="开始交易时间不能为空")
	public Date getBeginTradeDate() {
		return beginTradeDate;
	}

	public void setBeginTradeDate(Date beginTradeDate) {
		this.beginTradeDate = beginTradeDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="结束交易时间不能为空")
	public Date getEndTradeDate() {
		return endTradeDate;
	}

	public void setEndTradeDate(Date endTradeDate) {
		this.endTradeDate = endTradeDate;
	}
	
	@Length(min=0, max=255, message="订单类型长度必须介于 0 和 255 之间")
	public String getOrderType() {
		return orderType;
	}

	public void setOrderType(String orderType) {
		this.orderType = orderType;
	}

	public BigInteger getVersion() {
		return version;
	}

	public void setVersion(BigInteger version) {
		this.version = version;
	}
	
}